home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hottest 6
/
Hottest 6 (1996)(PDSoft)[!].iso
/
software
/
videoutils
/
a-g
/
ami2d
/
macros
/
hplot.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1978-11-24
|
3KB
|
101 lines
/* macro to plot model to printer or postscript file */
options results
parse arg dev num
address ami2d
'coord(cart)'
'info(window)'
parse var result xmin xmax ymin ymax
'info'
parse var result nnodes nelems nsolns
m = open('outfile','ram:plot.gnu','w')
select
when dev='dj' then do
m = writeln('outfile','set size 1.0,.83')
m = writeln('outfile','set term hpdj 300')
m = writeln('outfile','set output "par:"')
end
when dev='ps' then do
m = writeln('outfile','set size .6,.65')
m = writeln('outfile','set term postscript portrait "Bodoni-Normal" 14')
m = writeln('outfile','set output "ram:plot.ps"')
end
otherwise nop
end
m = writeln('outfile','set xlabel')
m = writeln('outfile','set ylabel')
m = writeln('outfile','set nokey')
m = writeln('outfile','set noxtics')
m = writeln('outfile','set noytics')
m = writeln('outfile','set noxzeroaxis')
m = writeln('outfile','set noyzeroaxis')
if num='nd' then do
dd = (xmax - xmin)/100
do i=0 to nnodes-1
'info(node,'i')'
parse var result nd id x1 y1
m = writeln('outfile','set label "'nd'" at 'x1 + dd','y1 - dd)
end
end
if num='id' then do
dd = (xmax - xmin)/100
do i=0 to nnodes-1
'info(node,'i')'
parse var result nd id x1 y1
m = writeln('outfile','set label "'id'" at 'x1 + dd','y1 - dd)
end
end
m = writeln('outfile','plot ['xmin':'xmax'] ['ymin':'ymax'] ''pipe:elems'' with lines,\')
m = writeln('outfile','''pipe:nodes'' with points 3')
m = close('outfile')
address command 'run gnuplot ram:plot.gnu'
m = open('outfile','pipe:elems','w')
m = writeln('outfile','# model - 'modelfile' nelems = 'nelems)
do i=0 to nelems-1
'info(elem,'i')'
parse var result nd id mid nn ni n.1 n.2 n.3 n.4 n.5 n.6 n.7 n.8 n.9
m = writeln('outfile','# element 'id)
if nn > 4 then do
nc = nn % 2
nm = 2
end
else do
nc = nn
nm = 1
end
do j=1 to nc
do k=1 to nm
l = j + nc*(k - 1)
'info(node,'n.l')'
parse var result nd id x1 y1
m = writech('outfile',left(x1,18))
m = writeln('outfile',left(y1,18))
end
end
'info(node,'n.1')'
parse var result nd id x1 y1
m = writech('outfile',left(x1,18))
m = writeln('outfile',left(y1,18))
m = writeln('outfile','')
end
m = close('outfile')
m = open('outfile','pipe:nodes','w')
m = writeln('outfile','# model - 'modelfile' nnodes = 'nnodes)
do i=0 to nnodes-1
'info(node,'i')'
parse var result nd id x1 y1
m = writech('outfile',left(x1,18))
m = writeln('outfile',left(y1,18))
end
m = close('outfile')
exit